Optimal. Leaf size=419 \[ \frac {2 \left (5 a^4 B-30 a^2 b^2 B-3 b^4 B+20 a^3 b (A-C)-4 a b^3 (5 A+3 C)\right ) \sqrt {\cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{5 d}+\frac {2 \left (84 a^3 b B+28 a b^3 B+42 a^2 b^2 (3 A+C)+7 a^4 (A+3 C)+b^4 (7 A+5 C)\right ) \sqrt {\cos (c+d x)} F\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{21 d}+\frac {2 b \left (609 a^2 b B+63 b^3 B-a^3 (70 A-366 C)+84 a b^2 (5 A+3 C)\right ) \sqrt {\sec (c+d x)} \sin (c+d x)}{105 d}+\frac {2 b^2 \left (98 a b B-a^2 (35 A-87 C)+5 b^2 (7 A+5 C)\right ) \sec ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{105 d}-\frac {2 b (35 a A-21 b B-39 a C) \sqrt {\sec (c+d x)} (a+b \sec (c+d x))^2 \sin (c+d x)}{105 d}-\frac {2 b (7 A-3 C) \sqrt {\sec (c+d x)} (a+b \sec (c+d x))^3 \sin (c+d x)}{21 d}+\frac {2 A (a+b \sec (c+d x))^4 \sin (c+d x)}{3 d \sqrt {\sec (c+d x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.82, antiderivative size = 419, normalized size of antiderivative = 1.00, number of steps
used = 10, number of rules used = 8, integrand size = 43, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.186, Rules used = {4179, 4181,
4161, 4132, 3856, 2720, 4131, 2719} \begin {gather*} \frac {2 b^2 \sin (c+d x) \sec ^{\frac {3}{2}}(c+d x) \left (-\left (a^2 (35 A-87 C)\right )+98 a b B+5 b^2 (7 A+5 C)\right )}{105 d}+\frac {2 b \sin (c+d x) \sqrt {\sec (c+d x)} \left (-\left (a^3 (70 A-366 C)\right )+609 a^2 b B+84 a b^2 (5 A+3 C)+63 b^3 B\right )}{105 d}+\frac {2 \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} F\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \left (7 a^4 (A+3 C)+84 a^3 b B+42 a^2 b^2 (3 A+C)+28 a b^3 B+b^4 (7 A+5 C)\right )}{21 d}+\frac {2 \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \left (5 a^4 B+20 a^3 b (A-C)-30 a^2 b^2 B-4 a b^3 (5 A+3 C)-3 b^4 B\right )}{5 d}-\frac {2 b \sin (c+d x) \sqrt {\sec (c+d x)} (35 a A-39 a C-21 b B) (a+b \sec (c+d x))^2}{105 d}-\frac {2 b (7 A-3 C) \sin (c+d x) \sqrt {\sec (c+d x)} (a+b \sec (c+d x))^3}{21 d}+\frac {2 A \sin (c+d x) (a+b \sec (c+d x))^4}{3 d \sqrt {\sec (c+d x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2719
Rule 2720
Rule 3856
Rule 4131
Rule 4132
Rule 4161
Rule 4179
Rule 4181
Rubi steps
\begin {align*} \int \frac {(a+b \sec (c+d x))^4 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sec ^{\frac {3}{2}}(c+d x)} \, dx &=\frac {2 A (a+b \sec (c+d x))^4 \sin (c+d x)}{3 d \sqrt {\sec (c+d x)}}+\frac {2}{3} \int \frac {(a+b \sec (c+d x))^3 \left (\frac {1}{2} (8 A b+3 a B)+\frac {1}{2} (3 b B+a (A+3 C)) \sec (c+d x)-\frac {1}{2} b (7 A-3 C) \sec ^2(c+d x)\right )}{\sqrt {\sec (c+d x)}} \, dx\\ &=-\frac {2 b (7 A-3 C) \sqrt {\sec (c+d x)} (a+b \sec (c+d x))^3 \sin (c+d x)}{21 d}+\frac {2 A (a+b \sec (c+d x))^4 \sin (c+d x)}{3 d \sqrt {\sec (c+d x)}}+\frac {4}{21} \int \frac {(a+b \sec (c+d x))^2 \left (\frac {3}{4} a (21 A b+7 a B-b C)+\frac {1}{4} \left (42 a b B+7 a^2 (A+3 C)+3 b^2 (7 A+5 C)\right ) \sec (c+d x)-\frac {1}{4} b (35 a A-21 b B-39 a C) \sec ^2(c+d x)\right )}{\sqrt {\sec (c+d x)}} \, dx\\ &=-\frac {2 b (35 a A-21 b B-39 a C) \sqrt {\sec (c+d x)} (a+b \sec (c+d x))^2 \sin (c+d x)}{105 d}-\frac {2 b (7 A-3 C) \sqrt {\sec (c+d x)} (a+b \sec (c+d x))^3 \sin (c+d x)}{21 d}+\frac {2 A (a+b \sec (c+d x))^4 \sin (c+d x)}{3 d \sqrt {\sec (c+d x)}}+\frac {8}{105} \int \frac {(a+b \sec (c+d x)) \left (\frac {1}{8} a \left (350 a A b+105 a^2 B-21 b^2 B-54 a b C\right )+\frac {1}{8} \left (315 a^2 b B+63 b^3 B+35 a^3 (A+3 C)+3 a b^2 (105 A+59 C)\right ) \sec (c+d x)+\frac {3}{8} b \left (98 a b B-a^2 (35 A-87 C)+5 b^2 (7 A+5 C)\right ) \sec ^2(c+d x)\right )}{\sqrt {\sec (c+d x)}} \, dx\\ &=\frac {2 b^2 \left (98 a b B-a^2 (35 A-87 C)+5 b^2 (7 A+5 C)\right ) \sec ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{105 d}-\frac {2 b (35 a A-21 b B-39 a C) \sqrt {\sec (c+d x)} (a+b \sec (c+d x))^2 \sin (c+d x)}{105 d}-\frac {2 b (7 A-3 C) \sqrt {\sec (c+d x)} (a+b \sec (c+d x))^3 \sin (c+d x)}{21 d}+\frac {2 A (a+b \sec (c+d x))^4 \sin (c+d x)}{3 d \sqrt {\sec (c+d x)}}+\frac {16}{315} \int \frac {\frac {3}{16} a^2 \left (350 a A b+105 a^2 B-21 b^2 B-54 a b C\right )+\frac {15}{16} \left (84 a^3 b B+28 a b^3 B+42 a^2 b^2 (3 A+C)+7 a^4 (A+3 C)+b^4 (7 A+5 C)\right ) \sec (c+d x)+\frac {3}{16} b \left (609 a^2 b B+63 b^3 B-a^3 (70 A-366 C)+84 a b^2 (5 A+3 C)\right ) \sec ^2(c+d x)}{\sqrt {\sec (c+d x)}} \, dx\\ &=\frac {2 b^2 \left (98 a b B-a^2 (35 A-87 C)+5 b^2 (7 A+5 C)\right ) \sec ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{105 d}-\frac {2 b (35 a A-21 b B-39 a C) \sqrt {\sec (c+d x)} (a+b \sec (c+d x))^2 \sin (c+d x)}{105 d}-\frac {2 b (7 A-3 C) \sqrt {\sec (c+d x)} (a+b \sec (c+d x))^3 \sin (c+d x)}{21 d}+\frac {2 A (a+b \sec (c+d x))^4 \sin (c+d x)}{3 d \sqrt {\sec (c+d x)}}+\frac {16}{315} \int \frac {\frac {3}{16} a^2 \left (350 a A b+105 a^2 B-21 b^2 B-54 a b C\right )+\frac {3}{16} b \left (609 a^2 b B+63 b^3 B-a^3 (70 A-366 C)+84 a b^2 (5 A+3 C)\right ) \sec ^2(c+d x)}{\sqrt {\sec (c+d x)}} \, dx+\frac {1}{21} \left (84 a^3 b B+28 a b^3 B+42 a^2 b^2 (3 A+C)+7 a^4 (A+3 C)+b^4 (7 A+5 C)\right ) \int \sqrt {\sec (c+d x)} \, dx\\ &=\frac {2 b \left (609 a^2 b B+63 b^3 B-a^3 (70 A-366 C)+84 a b^2 (5 A+3 C)\right ) \sqrt {\sec (c+d x)} \sin (c+d x)}{105 d}+\frac {2 b^2 \left (98 a b B-a^2 (35 A-87 C)+5 b^2 (7 A+5 C)\right ) \sec ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{105 d}-\frac {2 b (35 a A-21 b B-39 a C) \sqrt {\sec (c+d x)} (a+b \sec (c+d x))^2 \sin (c+d x)}{105 d}-\frac {2 b (7 A-3 C) \sqrt {\sec (c+d x)} (a+b \sec (c+d x))^3 \sin (c+d x)}{21 d}+\frac {2 A (a+b \sec (c+d x))^4 \sin (c+d x)}{3 d \sqrt {\sec (c+d x)}}+\frac {1}{5} \left (5 a^4 B-30 a^2 b^2 B-3 b^4 B+20 a^3 b (A-C)-4 a b^3 (5 A+3 C)\right ) \int \frac {1}{\sqrt {\sec (c+d x)}} \, dx+\frac {1}{21} \left (\left (84 a^3 b B+28 a b^3 B+42 a^2 b^2 (3 A+C)+7 a^4 (A+3 C)+b^4 (7 A+5 C)\right ) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {1}{\sqrt {\cos (c+d x)}} \, dx\\ &=\frac {2 \left (84 a^3 b B+28 a b^3 B+42 a^2 b^2 (3 A+C)+7 a^4 (A+3 C)+b^4 (7 A+5 C)\right ) \sqrt {\cos (c+d x)} F\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{21 d}+\frac {2 b \left (609 a^2 b B+63 b^3 B-a^3 (70 A-366 C)+84 a b^2 (5 A+3 C)\right ) \sqrt {\sec (c+d x)} \sin (c+d x)}{105 d}+\frac {2 b^2 \left (98 a b B-a^2 (35 A-87 C)+5 b^2 (7 A+5 C)\right ) \sec ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{105 d}-\frac {2 b (35 a A-21 b B-39 a C) \sqrt {\sec (c+d x)} (a+b \sec (c+d x))^2 \sin (c+d x)}{105 d}-\frac {2 b (7 A-3 C) \sqrt {\sec (c+d x)} (a+b \sec (c+d x))^3 \sin (c+d x)}{21 d}+\frac {2 A (a+b \sec (c+d x))^4 \sin (c+d x)}{3 d \sqrt {\sec (c+d x)}}+\frac {1}{5} \left (\left (5 a^4 B-30 a^2 b^2 B-3 b^4 B+20 a^3 b (A-C)-4 a b^3 (5 A+3 C)\right ) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \sqrt {\cos (c+d x)} \, dx\\ &=\frac {2 \left (5 a^4 B-30 a^2 b^2 B-3 b^4 B+20 a^3 b (A-C)-4 a b^3 (5 A+3 C)\right ) \sqrt {\cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{5 d}+\frac {2 \left (84 a^3 b B+28 a b^3 B+42 a^2 b^2 (3 A+C)+7 a^4 (A+3 C)+b^4 (7 A+5 C)\right ) \sqrt {\cos (c+d x)} F\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{21 d}+\frac {2 b \left (609 a^2 b B+63 b^3 B-a^3 (70 A-366 C)+84 a b^2 (5 A+3 C)\right ) \sqrt {\sec (c+d x)} \sin (c+d x)}{105 d}+\frac {2 b^2 \left (98 a b B-a^2 (35 A-87 C)+5 b^2 (7 A+5 C)\right ) \sec ^{\frac {3}{2}}(c+d x) \sin (c+d x)}{105 d}-\frac {2 b (35 a A-21 b B-39 a C) \sqrt {\sec (c+d x)} (a+b \sec (c+d x))^2 \sin (c+d x)}{105 d}-\frac {2 b (7 A-3 C) \sqrt {\sec (c+d x)} (a+b \sec (c+d x))^3 \sin (c+d x)}{21 d}+\frac {2 A (a+b \sec (c+d x))^4 \sin (c+d x)}{3 d \sqrt {\sec (c+d x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 7.47, size = 530, normalized size = 1.26 \begin {gather*} \frac {2 \cos ^6(c+d x) \left (\frac {2 \left (420 a^3 A b-420 a A b^3+105 a^4 B-630 a^2 b^2 B-63 b^4 B-420 a^3 b C-252 a b^3 C\right ) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{\sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}}+2 \left (35 a^4 A+630 a^2 A b^2+35 A b^4+420 a^3 b B+140 a b^3 B+105 a^4 C+210 a^2 b^2 C+25 b^4 C\right ) \sqrt {\cos (c+d x)} F\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}\right ) (a+b \sec (c+d x))^4 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{105 d (b+a \cos (c+d x))^4 (A+2 C+2 B \cos (c+d x)+A \cos (2 c+2 d x))}+\frac {(a+b \sec (c+d x))^4 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \left (\frac {4}{5} b \left (20 a A b^2+30 a^2 b B+3 b^3 B+20 a^3 C+12 a b^2 C\right ) \sin (c+d x)+\frac {4}{5} \sec ^2(c+d x) \left (b^4 B \sin (c+d x)+4 a b^3 C \sin (c+d x)\right )+\frac {4}{21} \sec (c+d x) \left (7 A b^4 \sin (c+d x)+28 a b^3 B \sin (c+d x)+42 a^2 b^2 C \sin (c+d x)+5 b^4 C \sin (c+d x)\right )+\frac {2}{3} a^4 A \sin (2 (c+d x))+\frac {4}{7} b^4 C \sec ^2(c+d x) \tan (c+d x)\right )}{d (b+a \cos (c+d x))^4 (A+2 C+2 B \cos (c+d x)+A \cos (2 c+2 d x)) \sec ^{\frac {11}{2}}(c+d x)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(1596\) vs.
\(2(439)=878\).
time = 0.34, size = 1597, normalized size = 3.81
method | result | size |
default | \(\text {Expression too large to display}\) | \(1597\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [C] Result contains higher order function than in optimal. Order 9 vs. order
4.
time = 1.12, size = 478, normalized size = 1.14 \begin {gather*} -\frac {5 \, \sqrt {2} {\left (7 i \, {\left (A + 3 \, C\right )} a^{4} + 84 i \, B a^{3} b + 42 i \, {\left (3 \, A + C\right )} a^{2} b^{2} + 28 i \, B a b^{3} + i \, {\left (7 \, A + 5 \, C\right )} b^{4}\right )} \cos \left (d x + c\right )^{3} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right ) + 5 \, \sqrt {2} {\left (-7 i \, {\left (A + 3 \, C\right )} a^{4} - 84 i \, B a^{3} b - 42 i \, {\left (3 \, A + C\right )} a^{2} b^{2} - 28 i \, B a b^{3} - i \, {\left (7 \, A + 5 \, C\right )} b^{4}\right )} \cos \left (d x + c\right )^{3} {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right ) + 21 \, \sqrt {2} {\left (-5 i \, B a^{4} - 20 i \, {\left (A - C\right )} a^{3} b + 30 i \, B a^{2} b^{2} + 4 i \, {\left (5 \, A + 3 \, C\right )} a b^{3} + 3 i \, B b^{4}\right )} \cos \left (d x + c\right )^{3} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right )\right ) + 21 \, \sqrt {2} {\left (5 i \, B a^{4} + 20 i \, {\left (A - C\right )} a^{3} b - 30 i \, B a^{2} b^{2} - 4 i \, {\left (5 \, A + 3 \, C\right )} a b^{3} - 3 i \, B b^{4}\right )} \cos \left (d x + c\right )^{3} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right )\right ) - \frac {2 \, {\left (35 \, A a^{4} \cos \left (d x + c\right )^{4} + 15 \, C b^{4} + 21 \, {\left (20 \, C a^{3} b + 30 \, B a^{2} b^{2} + 4 \, {\left (5 \, A + 3 \, C\right )} a b^{3} + 3 \, B b^{4}\right )} \cos \left (d x + c\right )^{3} + 5 \, {\left (42 \, C a^{2} b^{2} + 28 \, B a b^{3} + {\left (7 \, A + 5 \, C\right )} b^{4}\right )} \cos \left (d x + c\right )^{2} + 21 \, {\left (4 \, C a b^{3} + B b^{4}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{\sqrt {\cos \left (d x + c\right )}}}{105 \, d \cos \left (d x + c\right )^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: SystemError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {{\left (a+\frac {b}{\cos \left (c+d\,x\right )}\right )}^4\,\left (A+\frac {B}{\cos \left (c+d\,x\right )}+\frac {C}{{\cos \left (c+d\,x\right )}^2}\right )}{{\left (\frac {1}{\cos \left (c+d\,x\right )}\right )}^{3/2}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________